// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DBFactory.java

package com.sql;

import java.sql.Connection;
import java.sql.SQLException;

// Referenced classes of package com.sql:
//            ConnectionPool

public class DBFactory
{

    protected static ConnectionPool pc = new ConnectionPool();

    public DBFactory()
    {
    }

    public static void init()
    {
        if(pc == null)
            pc = new ConnectionPool();
        else
            pc.init();
    }

    public static void start()
    {
        if(pc == null)
            pc = new ConnectionPool();
        else
            pc.start();
    }

    public static int getSize()
    {
        if(pc == null)
            pc = new ConnectionPool();
        return pc.getSize();
    }

    public static int getUsed()
    {
        if(pc == null)
            pc = new ConnectionPool();
        return pc.getUseCount();
    }

    public static void destroy()
    {
        if(pc == null)
            pc = new ConnectionPool();
        else
            pc.destroy();
    }

    public static void restart()
    {
        if(pc == null)
            pc = new ConnectionPool();
        else
            pc.restart();
    }

    public static Connection getConnection()
        throws SQLException
    {
        if(pc == null || pc.connectionPool == null)
            pc = new ConnectionPool();
        return pc.getConnection();
    }

}
